<?php
class ModelTotalShipping extends Model {
	public function getTotal(&$total_data, &$total, &$taxes,$freight) {
	if ($this->cart->hasShipping() && isset($freight)) {
			$total_data[] = array(
				'code'       => 'shipping',
				'title'      => '快递运费',
				'value'      =>  $freight,
				'sort_order' => $this->config->get('shipping_sort_order'),
			    'type' =>6//1:小计  2:总计   3:折扣   4:秒杀  5:使用券  6:运费
			);

			//用户暂时没有选择快递方式
			/* if ($this->session->data['shipping_method']['tax_class_id']) {
				$tax_rates = $this->tax->getRates($this->session->data['shipping_method']['cost'], $this->session->data['shipping_method']['tax_class_id']);

				foreach ($tax_rates as $tax_rate) {
					if (!isset($taxes[$tax_rate['tax_rate_id']])) {
						$taxes[$tax_rate['tax_rate_id']] = $tax_rate['amount'];
					} else {
						$taxes[$tax_rate['tax_rate_id']] += $tax_rate['amount'];
					}
				}
			} */

			$total += $freight;
		}
	}
}